# frozen_string_literal: true

FactoryBot.define do
  sequence(:schema_variable_seq_name) { |n| "schema_variable_name_#{n}" }
  sequence(:schema_variable_seq_ordinal) { |n| n }

  factory :schema_variable do
    schema
    variable_type
    name { generate :schema_variable_seq_name }
    ordinal { generate :schema_variable_seq_ordinal }
    io_type { SchemaVariable::IoType::INPUT }
    required { false }
    default_value { nil }

    # io_type
    trait :input do
      io_type { SchemaVariable::IoType::INPUT }
    end
    trait :output do
      io_type { SchemaVariable::IoType::OUTPUT }
    end

    factory :schema_variable_input, traits: %i[input]
    factory :schema_variable_output, traits: %i[output]
  end
end
